package com.yanqu.road.server.cmd.systemgroup;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.union.SystemGroupMatchProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.systemgroup.Cross3SystemWeekGroupMatchMgr;
import com.yanqu.road.server.protocol.CrossProtocol;

import java.math.BigInteger;

@Cmd(code = CrossProtocol.C3_CROSS_SYSTEM_GROUP_MATCH_UPLOAD_SEVER_ABILITY, desc = "新榷场 上传区服能力")
public class CrossSystemServerUploadAbilityCmd extends CrossCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        SystemGroupMatchProto.ServerUploadAbilityMsg msg = SystemGroupMatchProto.ServerUploadAbilityMsg.parseFrom(packet.getBytes());
        Cross3SystemWeekGroupMatchMgr.uploadServerAbility(msg.getSystemId(), serverId, new BigInteger(msg.getAbility()));
    }

    @Override
    public void sendData() {

    }
}
